<template>
  <page-header-wrapper :title="false">
    <a-card>
      <a-tabs v-model="tab" type="card">
        <a-tab-pane key="1">
          <span slot="tab"><a-badge :count='count.to_be_completed_count' :overflow-count="9999">待完成案件</a-badge></span>
        </a-tab-pane>
        <a-tab-pane key="3" tab="完成案件"></a-tab-pane>
        <a-tab-pane key="2">
          <span slot="tab"><a-badge :count='count.feedback_count' :overflow-count="9999">案件反馈</a-badge></span>
        </a-tab-pane>
<!--        <a-tab-pane v-if="group == 'small_leader'" key="4" tab="全部案件"></a-tab-pane>-->
        <a-tab-pane key="4" tab="全部案件"></a-tab-pane>
      </a-tabs>
      <task v-if="tab == 1"></task>
      <feed-back v-if="tab == 2"></feed-back>
      <finish-task v-if="tab == 3"></finish-task>
      <all-task v-if="tab == 4"></all-task>
    </a-card>
  </page-header-wrapper>
</template>

<script>
import storage from 'store'
import Task from './components/Task'
import FeedBack from './components/FeedBack'
import FinishTask from './components/FinishTask'
import AllTask from '@/views/patent-process/components/AllTask'
import { GROUP } from '@/store/mutation-types'
import { getCaseCount } from '@/api/patent.process'

export default {
  components: {
    AllTask,
    FinishTask,
    Task,
    FeedBack
  },
  name: 'TaskList',
  data () {
    return {
      tab: '1',
      group: storage.get(GROUP),
      count: {}
    }
  },
  created () {
    getCaseCount('get_count').then(res => {
      if (res.status === 0) {
        this.count = res.result
      } else {
        this.$warning({
          title: res.msg
        })
      }
    })
  },
  methods: {
  }
}
</script>

<style scoped>

</style>
